home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / lantas.zip / NOS.INC < prev    next >
Text File  |  1992-01-04  |  14KB  |  330 lines

  1. CONST
  2.         
  3. D_NAMSZ      = 16 ; { Length of a name }
  4.  
  5.  
  6.     { User account structure }
  7.  
  8. TYPE 
  9.  
  10.         DWORD = Record
  11.           HiWord : Word;
  12.           LoWord : Word;
  13.         END;
  14.  
  15.         user_account = RECORD
  16.         
  17.     UA_name                         : Array[00..(D_NAMSZ-1)] of Char;        { Zero padded username }
  18.     UA_internal                     : Array[00..(D_NAMSZ-1)] of Char;        
  19.         UA_description                  : Array[00..31]          of Char;        { Full user description }
  20.     UA_privilege                    : Byte;        { Privilege bits  }
  21.                                         { (see definitions below) }
  22.     UA_concurrent                   : Byte;        { Maximum concurrent log ins }
  23.     UA_allowed_times                : Array[00..41] of Byte;        { 1 bit for each half hour for 7  }
  24.                                         { days. Week begins Sunday. }
  25.                                         { 0 means allowed. }
  26.     UA_internal2                    : Word;
  27.     UA_last_login_time              : Array[00..01] of Word;        { Last time logged in }
  28.     UA_account_expiration           : Array[00..01] of Word;     { Expiration date (MSDOS-format) }
  29.                                         { Year, Month:Day }
  30.     UA_password_expiration          : Array[00..01] of Word;    { Expiration date (as above) }
  31.                                         { 0 means no expiration date. }
  32.     UA_password_extension           : Byte;        { 1-31  Number of days to reextend }
  33.                                         { password after change, 0 says no  }
  34.                                         { extension required }
  35.     UA_undelete_char                : Byte;            { First letter of UA_name when   }
  36.                                         { account is deleted (first  }
  37.                                         { character of UA_name is replaced  }
  38.                                         { with a zero.) }
  39.     UA_xprivilege                   : Byte;                { Extended privilege }
  40.     UA_future                       : Array[00..02] of Byte;        
  41.  
  42.         END;
  43.  
  44.     { Privilege bits for UA_privilege: }
  45. CONST
  46.  
  47. UA_privilege_superACL     = $80;    { Bypass ACLs }
  48. UA_privilege_superqueue  = $40;    { Bypass queue protection }
  49. UA_privilege_peer        = $20;    { Treat as local process }
  50. UA_privilege_supermail   = $10;    { Bypass mail protection }
  51. UA_privilege_audit       = $08;    { User can create audit entries }
  52. UA_privilege_system      = $04;    { User has system manager privileges }
  53. UA_xprivilege_nopwchange = $01;   { User cannot change password }
  54.  
  55. MB_textlen             = 80;                    { Length of message text buffer }
  56.  
  57. TYPE                                        { Message buffer structure }
  58.         message_buffer     = RECORD
  59.  
  60.     MB_reserved             : Byte;                { Reserved field used by system call }
  61.     MB_type                 : Byte;                    { User defined message type  }
  62.                                         { (see below) }
  63.     MB_machine              : Array[00..(D_NAMSZ-1)] of Char;        { Machine name destination }
  64.     MB_server               : Array[00..(D_NAMSZ-1)] of Char;        { User must be logged into this }
  65.                                         { server }
  66.     MB_user                 : Array[00..(D_NAMSZ-1)] of Char;            { User must be using this username }
  67.     MB_originator           : Array[00..(D_NAMSZ-1)] of Char;    { Originator's machine name.  }
  68.                                         { Filled when message is received }
  69.     MB_text                 : Array[00..(MB_textlen-1)] of Char;        { Message text }
  70.  
  71.         END;
  72.  
  73.     { Message buffer type.   }
  74.  
  75. CONST
  76.  
  77. MBT_general    = 0;                    { General msg used by NET and others }
  78. MBT_warning    = 1;                    { Server warning message }
  79.  
  80.     { Message service disposition }
  81.  
  82. MPB_beep        = $01;            { Beep before delivering message }
  83. MPB_deliver        = $02;            { Deliver to message service }
  84. MPB_auto_pop_up            = $04;            { Pop up messages automatically }
  85.  
  86.     { Definition of a queue entry: }
  87.  
  88. TYPE
  89.  
  90.         queue_entry = RECORD
  91.         
  92.     QE_status                       : Byte;                    { Status of queue entry }
  93.     QE_size                         : DWORD;                    { Size of spooled file }
  94.     QE_type                         : Byte;                    { Type of queue entry }
  95.     QE_output_control               : Byte;            { Control of despooled file }
  96.     QE_copies                       : Word;                    { Number of copies }
  97.     QE_sequence                     : DWORD;                { Sequence number of queue entry }
  98.     QE_spooled_file                 : Array[00..47] of Char;        { Pathname of spooled file }
  99.     QE_user                         : Array[00..(D_NAMSZ-1)] of Char;            { Username who spooled file }
  100.     QE_machine                      : Array[00..(D_NAMSZ-1)] of Char;        { Machine name user was on }
  101.     QE_date                         : Word;                    { Date file spooled (MS-DOS format) }
  102.     QE_time                         : Word;                    { Time file spooled (MS-DOS format) }
  103.     QE_destination                  : Array[00..D_NAMSZ] of Char;    { ASCIZ Device or username destn. }
  104.     QE_comment                      : Array[00..47] of Char;                { Comment field }
  105.  
  106.         END;
  107.  
  108.  
  109. CONST
  110.     { Different queue entry statuses }
  111.  
  112. QE_status_free        =    0;    { The queue entry is empty }
  113. QE_status_update    =    1;    { The queue entry is being updated }
  114. QE_status_hold        =    2;    { The queue entry is held }
  115. QE_status_wait        =    3;    { The queue entry is waiting for despool }
  116. QE_status_active    =    4;    { The queue entry is being despooled }
  117. QE_status_cancel    =    5;    { The queue has been canceled }
  118. QE_status_file_error    =       6;    { The spooled file could not be accessed }
  119. QE_status_spool_error    =       7;    { The destination could not be accessed }
  120. QE_status_rush        =    8;    { Rush this job }
  121.     
  122.     { Different types of queue entries: }
  123.     
  124. QE_type_print        =       0;    { Spooled printer queue file }
  125. QE_type_message        =       1;    { Spooled message (mail) }
  126. QE_type_local_file    =       2;    { Spooled local file }
  127. QE_type_remote_file    =       3;    { Spooled remote file }
  128. QE_type_modem        =       4;    { Spooled to remote modem }
  129. QE_type_batch        =       5;    { Spooled batch processor file }
  130.  
  131.     { Definitions for output control: }
  132.  
  133. QE_OC_keep            = $40;    { Keep after despooling (don't delete) }
  134.                             { Used for mail - allow delete only by owner }
  135.  
  136.     { Definitions for mail }
  137.  
  138. QE_OC_voice         = $20;    { Mail file contains voice data }
  139. QE_OC_opened         = $10;    { Message has been read }
  140. QE_OC_request_response     = $04;    { Response requested }
  141.  
  142.     { Control queue commands. }
  143.  
  144. CQ_start            = 0;    { Start despooling }
  145. CQ_halt                = 1;    { Halt despooling }
  146. CQ_halt_EOJ            = 2;    { Halt despooling at end of job }
  147. CQ_pause            = 3;    { Pause the despooler at end of job }
  148. CQ_single            = 4;    { Print single job }
  149. CQ_restart            = 5;    { Restart the current print job }
  150. CQ_cancel            = 6;    { Cancel the currently printing job }
  151. CQ_hold                = 7;    { Hold the queue entry }
  152. CQ_release            = 8;    { Release a held queue entry }
  153. CQ_rush                = 9;    { Make the queue entry a rushed job }
  154.  
  155. TYPE
  156.  
  157.     { Definition of printer states: }
  158.  
  159.         printer_state = RECORD
  160.         
  161.     PS_state_pause                 : Byte;    { Set 1 when printer paused }
  162.     PS_state_value                 : Byte;    { Set to PS_state_ value (see below) }
  163.  
  164.         END;
  165.  
  166. CONST
  167.  
  168. PS_state_disabled    = 0;    { Printer is disabled }
  169. PS_state_single_job    = 1;    { Printer will stop at end of job }
  170. PS_state_multijob    = 2;    { Printer should print multiple jobs }
  171.  
  172. TYPE
  173.     { Definition of a printer status entry: }
  174.  
  175.         PS  = RECORD
  176.                             { Printer state }
  177.     PS_state        : Byte;
  178.     PS_index        : Word;        { Queue index corresponding to print job  }
  179.                             { being despooled. -1 if not despooling. }
  180.     PS_CPS          : Word;            { Actual characters per second being output }
  181.     PS_output_chars : DWORD; { Characters actually output so far }
  182.     PS_read_chars    : DWORD; { Characters actually read from despooled  }
  183.                             { file so far. May be used to compute  }
  184.                             { percent completed. }
  185.     PS_copies        : Word;        { Copies remaining to print }
  186.  
  187.         END;
  188.  
  189.     { Definition of logical stream entry: }
  190.  
  191.         logical_stream = RECORD
  192.         
  193.     LS_queue                : Byte;                { 0 Disabled, non-zero Enabled }
  194.     LS_template             : Array[00..12] of Char;{ Template may contain ?'s (include "." as  }
  195.                             { in @???????.???) }
  196.         END;
  197.  
  198.     { Definition of active user entry: }
  199.  
  200.         active_user_entry = RECORD
  201.         
  202.     AUE_VCID                : Word;                { Virtual circuit number }
  203.     AUE_state               : Byte;                { Login state (defined below) }
  204.     AUE_command             : Byte;               { Last command issued }
  205.     AUE_IO                  : Array[00..04] of Byte;                { Number of I/O bytes (40 bit number) }
  206.     AUE_requests            : Array[00..02] of Byte;        { Number of server requests (24 bits) }
  207.     AUE_name                : Array[00..(D_NAMSZ-1)] of Char;        { Name of logged in user }
  208.     AUE_machine             : Array[00..(D_NAMSZ-1)] of Char;    { Name of remote logged in machine }
  209.     AUE_xprivilege          : Byte;            { Extended privileges }
  210.     AUE_time_left           : Word;            { Time left in minutes }
  211.  
  212.         END;
  213.  
  214. CONST
  215.  
  216.     { Definition of the various login states and privileges: }
  217.  
  218. AUE_state_starting         = $00;    { We are in the middle of login }
  219. AUE_state_in             = $01;    { We are fully logged in }
  220. AUE_state_RPL             = $02;    { Remote program load login }
  221.  
  222. AUE_privilege_superACL         = $80;    { Bypass ACLs }
  223. AUE_privilege_superqueue    = $40;    { Bypass queue protection }
  224. AUE_privilege_peer           = $20;    { Treat as local process }
  225. AUE_privilege_supermail      = $10;    { Bypass mail protection }
  226. AUE_privilege_audit          = $08;    { User can create audit entries }
  227. AUE_privilege_system         = $04;    { User has system manager privs }
  228. AUE_xprivilege_nopwchange    = $01;    { User cannot change his password }
  229.  
  230.     { Active user entry commands: }
  231.  
  232. AUEC_login            = 0;    { Login into a server }
  233. AUEC_terminate            = 1;    { Process termination }
  234. AUEC_open            = 2;    { Open a file }
  235. AUEC_close            = 3;    { Close a file }
  236. AUEC_create            = 4;    { Create a file if it's there or not }
  237. AUEC_new            = 5;    { Create a new file that is not there }
  238. AUEC_unique            = 6;    { Create a unique file }
  239. AUEC_commit            = 7;    { Commit disk data to disk }
  240. AUEC_read            = 8;    { Read from file }
  241. AUEC_write            = 9;    { Write to file }
  242. AUEC_delete            = 10;    { Delete file }
  243. AUEC_set_attr            = 11;    { Set file attributes }
  244. AUEC_lock            = 12;    { Lock byte range }
  245. AUEC_unlock            = 13;    { Unlock byte range }
  246. AUEC_create_dir            = 14;    { Create a subdirectory }
  247. AUEC_delete_dir            = 15;    { Delete a subdirectory }
  248. AUEC_rename_file        = 16;    { Rename a file }
  249. AUEC_find_first            = 17;    { Find first matching file }
  250. AUEC_find_next            = 18;    { Find the next matching file }
  251. AUEC_disk_free            = 19;    { Get disk free space }
  252. AUEC_get_queue            = 20;    { Get a queue entry }
  253. AUEC_set_queue            = 21;    { Set a queue entry }
  254. AUEC_control_queue        = 22;    { Control the queue }
  255. AUEC_get_login            = 23;    { Return login information }
  256. AUEC_get_link            = 24;    { Return link description }
  257. AUEC_seek            = 25;    { Seek to a file position }
  258. AUEC_get_time            = 26;    { Get server's time }
  259. AUEC_audit            = 27;    { Create audit entry }
  260. AUEC_multi_open            = 28;    { Open file in a multitude of modes }
  261. AUEC_change_password            = 29;    { Change a password }
  262. AUEC_disable_account            = 30;    { Disable account from further log ins }
  263. AUEC_copy_file            = 31;    { Local server file copy }
  264. AUEC_get_username        = 32;    { Get a username from account file }
  265. AUEC_translate_path        = 33;    { Translate a server's logical path }
  266. AUEC_create_indirect            = 34;    { Make indirect file }
  267. AUEC_get_indirect        = 35;    { Get indirect file text }
  268. AUEC_printer_status        = 36;    { Printer status obtained }
  269. AUEC_get_stream            = 37;    { Get logical print stream information }
  270. AUEC_set_stream            = 38;    { Set logical print stream information }
  271. AUEC_get_account        = 39;    { Get an account record }
  272. AUEC_shutdown            = 40;    { Request server shutdown }
  273. AUEC_cancel_shutdown            = 41;    { Cancel server shutdown }
  274. AUEC_stuff            = 42;    { Stuff server keyboard }
  275. AUEC_write_with_commit            = 43;    { Commit data to disk }
  276.  
  277.     { ACL bit definition: }
  278.  
  279. ACL_read        = $8000;    { (R) Allow reading }
  280. ACL_write        = $4000;    { (W) Allow writing }
  281. ACL_create_file         = $2000;    { (C) Allow file creation }
  282. ACL_create_dir          = $1000;    { (M) Allow directory creation }
  283. ACL_lookup              = $0800;    { (L) Allow lookups }
  284. ACL_delete_file            = $0400;    { (D) Allow file deletion }
  285. ACL_delete_dir          = $0200;    { (K) Allow directory deletion }
  286. ACL_rename              = $0100;    { (N) Allow file renaming }
  287. ACL_execute             = $0080;    { (E) Allow program execution }
  288. ACL_physical            = $0040;    { (P) Allow physical access }
  289. ACL_attribute           = $0020;    { (A) Allow attribute changing }
  290. ACL_indirect            = $0010;    { (I) Allow indirect file expansion }
  291.  
  292. TYPE
  293.     { Definition of time buffer: }
  294.  
  295.         time_block = RECORD
  296.         
  297.     TB_year                 : Word;        { Year }
  298.     TB_day                  : Byte;        { Day of month (1-31) }
  299.     TB_month                : Byte;        { Month (1-12) }
  300.     TB_minutes              : Byte;        { Minutes (0-59) }
  301.     TB_hour                 : Byte;        { Hour (0-23) }
  302.     TB_hundredths           : Byte;            { Hundredths of seconds (0-99) }
  303.     TB_seconds              : Byte;        { Seconds (0-59) }
  304.         
  305.         END;
  306.  
  307.  
  308. CONST
  309.  
  310.     { Definition of server shutdown option flags }
  311.  
  312. SHUTDOWN_option_reboot        = $0001;        { Reboot after shutdown }
  313. SHUTDOWN_option_silent        = $0002;    { Do not notify users }
  314. SHUTDOWN_option_halt        = $0004;    { Halt after shutdown }
  315. SHUTDOWN_option_powerfail    = $0008;    { Shutdown due to power fail }
  316.                                             { (Used by UPS.) }
  317. SHUTDOWN_option_reserved1    = $0010;    { RESERVED }
  318. SHUTDOWN_option_reserved2    = $0020;
  319. SHUTDOWN_option_reserved3    = $0040;
  320. SHUTDOWN_option_reserved4    = $0080;
  321. SHUTDOWN_option_user1        = $0100;    { User definable }
  322. SHUTDOWN_option_user2        = $0200;
  323. SHUTDOWN_option_user3        = $0400;
  324. SHUTDOWN_option_user4        = $0800;
  325. SHUTDOWN_option_user5        = $1000;
  326. SHUTDOWN_option_user6        = $2000;
  327. SHUTDOWN_option_user7        = $4000;
  328. SHUTDOWN_option_reserved5    = $8000;    { RESERVED }
  329.  
  330.